package site.codeyin.javautils.controller.excel;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@Getter
@Setter
@EqualsAndHashCode
@ToString
public class DemoData {

    @ExcelProperty("字符串标题")
    @NotBlank
    private String string;

    @ExcelProperty("日期标题")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date date;

    @ExcelProperty("数字标题")
    @Max(100)
    @Min(1)
    private Double doubleData;
    /**
     * 忽略这个字段
     */
    @ExcelIgnore
    private String ignore;
}